package com.fresh.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean;
import com.fresh.entity.FreshGoods;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface GoodsMapper extends BaseMapper<FreshGoods> {

    List<FreshGoods> selectAll();

    FreshGoods selectById(Long goodsId);

    /**
     * 下订单后修改库存
     * */
    void updateById(@Param("goodsId") Long  goodsId,@Param("stock") Integer stock);

    void add(FreshGoods freshGoods);

}
